package com.yike.product.param;

import com.yike.common.api.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 商品分类
 *
 * @author Sakura
 * @since 2024-09-02
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "分类参数")
public class CategoryParam implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotNull(message = "id不能为空", groups = {Update.class})
    @ApiModelProperty("id, 修改必传")
    private Long id;

    @ApiModelProperty("上级分类ID，顶层为0")
    @NotNull(message = "上级分类ID不能为空")
    private Long parentId;

    @ApiModelProperty(value = "分类名称", required = true)
    @NotBlank(message = "分类名称不能为空")
    private String name;

    @ApiModelProperty("分类级别：0->1级；1->2级")
    private Integer level;

    @ApiModelProperty("所属店铺")
    @NotNull(message = "所属店铺不能为空")
    private Long shopId;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("描述")
    private String description;

}
